import api from './index'

/**
 * 积分相关API接口
 */

// 获取积分统计信息
export const getPointsStats = () => {
  return api.get('points/stats')
}

// 获取积分记录列表
export const getPointsRecords = (params = {}) => {
  return api.get('points/records', { params })
}

// 获取积分记录详情
export const getPointsRecordDetail = (recordId) => {
  return api.get(`points/records/${recordId}`)
}

// 增加积分
export const addPoints = (data) => {
  return api.post('points/add', data)
}

// 扣除积分
export const deductPoints = (data) => {
  return api.post('points/deduct', data)
}

// 检查积分余额
export const checkPointsBalance = (requiredPoints) => {
  return api.post('points/check-balance', { requiredPoints })
}

// 获取积分规则说明
export const getPointsRules = () => {
  return api.get('points/rules')
}

// 获取积分过期提醒
export const getExpirationReminder = () => {
  return api.get('points/expiration-reminder')
} 